package main.java.com.chankudo.fuctionalinterface;

import java.util.function.Consumer;
import java.util.function.Supplier;

public class UseFuctionalInterfaceDemo {
    /**
     * 消费型接口 Consumer<T>    void accept(T t)
     * @param obj
     * @param consumer
     */
    public <T> void  useConsumer(T t, Consumer<T> consumer){
        consumer.accept(t);
        return;
    }
    
    public <T> T useSupplier(Supplier <T> supplier){
        return supplier.get();
    }
}
